//
//  PostImageCell.h
//  com.yjwh.yj
//
//  Created by ferver7 on 2018/10/10.
//  Copyright © 2018年 ferver7. All rights reserved.
//

#import "MDDTableCell.h"
#import "TZImagePickerController.h"
#import "ACMediaManager.h"
#import "ACMediaModel.h"

typedef void(^PostImageCellHeightBlock)(CGFloat mediaHeight);
typedef void(^PostSelectMediaBackBlock)(NSMutableArray<ACMediaModel *> *list);
typedef void(^PostExchangeImagesPoszition)(NSInteger start,NSInteger end);
typedef void(^PostImageDelBlock)(NSInteger index);

typedef NS_ENUM(NSInteger, PostImageCell_State) {
    PostImageCell_State_Normal = 0,         // 默认
    PostImageCell_State_Adding,           // 添加中
    PostImageCell_State_FullAdd           // 添加完成
};

@interface PostImageCell : MDDTableCell<TZImagePickerControllerDelegate,UICollectionViewDelegate,UICollectionViewDataSource>

@property (nonatomic,strong) UIViewController * rootVC;
@property (weak, nonatomic) IBOutlet UICollectionView *selfCollectionView;
@property(nonatomic, assign)CGFloat contentMargin;
@property(nonatomic, assign)CGFloat contentPadding;
@property(nonatomic, assign)CGFloat itemSpace;

@property(nonatomic, assign)NSInteger boolChangeIndex;//申请拍卖 不可变

@property(nonatomic, assign)PostImageCell_State postCell_State;
@property(nonatomic, assign)NSInteger maxSelImages;
/** 媒体信息数组 */
@property (nonatomic, strong) NSMutableArray *mediaArray;

/** 已经上传媒体信息组的图片 */
@property (nonatomic, strong) NSMutableArray *postImageArr;

/** 上传失败的图片 */
@property (nonatomic, strong) NSMutableArray *postFailImageArr;

/** 拍卖已鉴定的图片*/
@property (nonatomic, strong) NSMutableArray *postUrlArr;

/** 监控view的高度变化 */
- (void)observeViewHeight: (PostImageCellHeightBlock)value;

/** 随时监控当前选择到的媒体文件 */
- (void)observeSelectedMediaArray: (PostSelectMediaBackBlock)backBlock;

/** 图片交换位置 */
- (void)observePostExchangeImagesPoszition: (PostExchangeImagesPoszition)exBlock;
/** 删除图片 */
- (void)observeImageDelBlock: (PostImageDelBlock)delBlock;

+ (CGFloat)defaultCellHeight;

@end
